<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.math.Math</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.math.Math";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.math.Math.html" class="symbol">tango.math.Math</a></h1>
  
<div class="summary">Elementary Mathematical Functions</div>
<p class="sec_header">License:</p>BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>, Digital Mars.
<p class="sec_header">Authors:</p>Walter Bright, Don Clugston, Sean Kelly
<dl>
<dt class="decl">real <a class="symbol _variable" name="E" href="./htmlsrc/tango.math.Math.html#L84" kind="variable" beg="84" end="84">E</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#E" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L84">#</a></dt>
<dd class="ddef">
<div class="summary">e</div></dd>
<dt class="decl">real <a class="symbol _variable" name="LOG2T" href="./htmlsrc/tango.math.Math.html#L85" kind="variable" beg="85" end="85">LOG2T</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#LOG2T" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L85">#</a></dt>
<dd class="ddef">
<div class="summary">log<sub>2</sub>10</div></dd>
<dt class="decl">real <a class="symbol _variable" name="LOG2E" href="./htmlsrc/tango.math.Math.html#L86" kind="variable" beg="86" end="86">LOG2E</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#LOG2E" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L86">#</a></dt>
<dd class="ddef">
<div class="summary">log<sub>2</sub>e</div></dd>
<dt class="decl">real <a class="symbol _variable" name="LOG2" href="./htmlsrc/tango.math.Math.html#L87" kind="variable" beg="87" end="87">LOG2</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#LOG2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L87">#</a></dt>
<dd class="ddef">
<div class="summary">log<sub>10</sub>2</div></dd>
<dt class="decl">real <a class="symbol _variable" name="LOG10E" href="./htmlsrc/tango.math.Math.html#L88" kind="variable" beg="88" end="88">LOG10E</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#LOG10E" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L88">#</a></dt>
<dd class="ddef">
<div class="summary">log<sub>10</sub>e</div></dd>
<dt class="decl">real <a class="symbol _variable" name="LN2" href="./htmlsrc/tango.math.Math.html#L89" kind="variable" beg="89" end="89">LN2</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#LN2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L89">#</a></dt>
<dd class="ddef">
<div class="summary">ln 2</div></dd>
<dt class="decl">real <a class="symbol _variable" name="LN10" href="./htmlsrc/tango.math.Math.html#L90" kind="variable" beg="90" end="90">LN10</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#LN10" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L90">#</a></dt>
<dd class="ddef">
<div class="summary">ln 10</div></dd>
<dt class="decl">real <a class="symbol _variable" name="PI" href="./htmlsrc/tango.math.Math.html#L91" kind="variable" beg="91" end="91">PI</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#PI" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L91">#</a></dt>
<dd class="ddef">
<div class="summary">&pi;</div></dd>
<dt class="decl">real <a class="symbol _variable" name="PI_2" href="./htmlsrc/tango.math.Math.html#L92" kind="variable" beg="92" end="92">PI_2</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#PI_2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L92">#</a></dt>
<dd class="ddef">
<div class="summary">&pi; / 2</div></dd>
<dt class="decl">real <a class="symbol _variable" name="PI_4" href="./htmlsrc/tango.math.Math.html#L93" kind="variable" beg="93" end="93">PI_4</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#PI_4" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L93">#</a></dt>
<dd class="ddef">
<div class="summary">&pi; / 4</div></dd>
<dt class="decl">real <a class="symbol _variable" name="M_1_PI" href="./htmlsrc/tango.math.Math.html#L94" kind="variable" beg="94" end="94">M_1_PI</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#M_1_PI" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L94">#</a></dt>
<dd class="ddef">
<div class="summary">1 / &pi;</div></dd>
<dt class="decl">real <a class="symbol _variable" name="M_2_PI" href="./htmlsrc/tango.math.Math.html#L95" kind="variable" beg="95" end="95">M_2_PI</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#M_2_PI" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L95">#</a></dt>
<dd class="ddef">
<div class="summary">2 / &pi;</div></dd>
<dt class="decl">real <a class="symbol _variable" name="M_2_SQRTPI" href="./htmlsrc/tango.math.Math.html#L96" kind="variable" beg="96" end="96">M_2_SQRTPI</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#M_2_SQRTPI" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L96">#</a></dt>
<dd class="ddef">
<div class="summary">2 / &radic;&pi;</div></dd>
<dt class="decl">real <a class="symbol _variable" name="SQRT2" href="./htmlsrc/tango.math.Math.html#L97" kind="variable" beg="97" end="97">SQRT2</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#SQRT2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L97">#</a></dt>
<dd class="ddef">
<div class="summary">&radic;2</div></dd>
<dt class="decl">real <a class="symbol _variable" name="SQRT1_2" href="./htmlsrc/tango.math.Math.html#L98" kind="variable" beg="98" end="98">SQRT1_2</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#SQRT1_2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L98">#</a></dt>
<dd class="ddef">
<div class="summary">&radic;&frac12</div></dd>
<dt class="decl">real <a class="symbol _variable" name="MAXLOG" href="./htmlsrc/tango.math.Math.html#L103" kind="variable" beg="103" end="103">MAXLOG</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#MAXLOG" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L103">#</a></dt>
<dd class="ddef">
<div class="summary">log(real.max)</div></dd>
<dt class="decl">real <a class="symbol _variable" name="MINLOG" href="./htmlsrc/tango.math.Math.html#L104" kind="variable" beg="104" end="104">MINLOG</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#MINLOG" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L104">#</a></dt>
<dd class="ddef">
<div class="summary">log(real.min*real.epsilon)</div></dd>
<dt class="decl">real <a class="symbol _variable" name="EULERGAMMA" href="./htmlsrc/tango.math.Math.html#L105" kind="variable" beg="105" end="105">EULERGAMMA</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#EULERGAMMA" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L105">#</a></dt>
<dd class="ddef">
<div class="summary">Euler-Mascheroni constant 0.57721566..</div></dd>
<dt class="decl">real <a class="symbol _function" name="abs" href="./htmlsrc/tango.math.Math.html#L117" kind="function" beg="117" end="120">abs</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#abs" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L117">#</a></dt>
<dt class="decl">long <a class="symbol _function" name="abs:2" href="./htmlsrc/tango.math.Math.html#L123" kind="function" beg="123" end="126">abs</a><span class="params">(long <em>x</em>)</span>; <a title="Permalink to this symbol" href="#abs:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L123">#</a></dt>
<dt class="decl">int <a class="symbol _function" name="abs:3" href="./htmlsrc/tango.math.Math.html#L129" kind="function" beg="129" end="132">abs</a><span class="params">(int <em>x</em>)</span>; <a title="Permalink to this symbol" href="#abs:3" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L129">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="abs:4" href="./htmlsrc/tango.math.Math.html#L135" kind="function" beg="135" end="138">abs</a><span class="params">(creal <em>z</em>)</span>; <a title="Permalink to this symbol" href="#abs:4" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L135">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="abs:5" href="./htmlsrc/tango.math.Math.html#L141" kind="function" beg="141" end="144">abs</a><span class="params">(ireal <em>y</em>)</span>; <a title="Permalink to this symbol" href="#abs:5" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L141">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the absolute value</div>
For complex numbers, abs(z) = sqrt( z.re<sup>2</sup> + z.im<sup>2</sup> )
 = hypot(z.re, z.im).</dd>
<dt class="decl">creal <a class="symbol _function" name="conj" href="./htmlsrc/tango.math.Math.html#L168" kind="function" beg="168" end="171">conj</a><span class="params">(creal <em>z</em>)</span>; <a title="Permalink to this symbol" href="#conj" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L168">#</a></dt>
<dt class="decl">ireal <a class="symbol _function" name="conj:2" href="./htmlsrc/tango.math.Math.html#L174" kind="function" beg="174" end="177">conj</a><span class="params">(ireal <em>y</em>)</span>; <a title="Permalink to this symbol" href="#conj:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L174">#</a></dt>
<dd class="ddef">
<div class="summary">Complex conjugate</div>
conj(x + iy) = x - iy
<p class="bl"/>
 Note that z * conj(z) = z.re<sup>2</sup> + z.im<sup>2</sup>
 is always a real number</dd>
<dt class="decl">minmaxtype!(T) <a class="symbol _function" name="min" href="./htmlsrc/tango.math.Math.html#L203" kind="function" beg="203" end="207">min</a><span class="tparams">(T...)</span><span class="params">(T <em>arg</em>)</span>; <a title="Permalink to this symbol" href="#min" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L203">#</a></dt>
<dd class="ddef">
<div class="summary">Return the minimum of the supplied arguments.</div>
<p class="sec_header">Note:</p>If the arguments are floating-point numbers, and at least one is a NaN,
 the result is undefined.</dd>
<dt class="decl">minmaxtype!(T) <a class="symbol _function" name="max" href="./htmlsrc/tango.math.Math.html#L214" kind="function" beg="214" end="218">max</a><span class="tparams">(T...)</span><span class="params">(T <em>arg</em>)</span>; <a title="Permalink to this symbol" href="#max" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L214">#</a></dt>
<dd class="ddef">
<div class="summary">Return the maximum of the supplied arguments.</div>
<p class="sec_header">Note:</p>If the arguments are floating-point numbers, and at least one is a NaN,
 the result is undefined.</dd>
<dt class="decl">real <a class="symbol _function" name="minNum" href="./htmlsrc/tango.math.Math.html#L238" kind="function" beg="238" end="240">minNum</a><span class="params">(real <em>x</em>, real <em>y</em>)</span>; <a title="Permalink to this symbol" href="#minNum" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L238">#</a></dt>
<dd class="ddef">
<div class="summary">Returns the minimum number of x and y, favouring numbers over NaNs.</div>
If both x and y are numbers, the minimum is returned.
 If both parameters are NaN, either will be returned.
 If one parameter is a NaN and the other is a number, the number is
 returned (this behaviour is mandated by IEEE 754R, and is useful
 for determining the range of a function).</dd>
<dt class="decl">real <a class="symbol _function" name="maxNum" href="./htmlsrc/tango.math.Math.html#L250" kind="function" beg="250" end="252">maxNum</a><span class="params">(real <em>x</em>, real <em>y</em>)</span>; <a title="Permalink to this symbol" href="#maxNum" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L250">#</a></dt>
<dd class="ddef">
<div class="summary">Returns the maximum number of x and y, favouring numbers over NaNs.</div>
If both x and y are numbers, the maximum is returned.
 If both parameters are NaN, either will be returned.
 If one parameter is a NaN and the other is a number, the number is
 returned (this behaviour is mandated by IEEE 754R, and is useful
 for determining the range of a function).</dd>
<dt class="decl">real <a class="symbol _function" name="minNaN" href="./htmlsrc/tango.math.Math.html#L260" kind="function" beg="260" end="262">minNaN</a><span class="params">(real <em>x</em>, real <em>y</em>)</span>; <a title="Permalink to this symbol" href="#minNaN" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L260">#</a></dt>
<dd class="ddef">
<div class="summary">Returns the minimum of x and y, favouring NaNs over numbers</div>
If both x and y are numbers, the minimum is returned.
 If both parameters are NaN, either will be returned.
 If one parameter is a NaN and the other is a number, the NaN is returned.</dd>
<dt class="decl">real <a class="symbol _function" name="maxNaN" href="./htmlsrc/tango.math.Math.html#L270" kind="function" beg="270" end="272">maxNaN</a><span class="params">(real <em>x</em>, real <em>y</em>)</span>; <a title="Permalink to this symbol" href="#maxNaN" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L270">#</a></dt>
<dd class="ddef">
<div class="summary">Returns the maximum of x and y, favouring NaNs over numbers</div>
If both x and y are numbers, the maximum is returned.
 If both parameters are NaN, either will be returned.
 If one parameter is a NaN and the other is a number, the NaN is returned.</dd>
<dt class="decl">real <a class="symbol _function" name="cos" href="./htmlsrc/tango.math.Math.html#L301" kind="function" beg="301" end="315">cos</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#cos" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L301">#</a></dt>
<dd class="ddef">
<div class="summary">Returns cosine of x. x is in radians.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr><th>x</th>               <th>cos(x)</th> <th>invalid?</th>  </tr>
  <tr><td><span class="red">NAN</span></td>          <td><span class="red">NAN</span></td> <td>yes</td>   </tr>
  <tr><td>&plusmn;&infin;</td> <td><span class="red">NAN</span></td> <td>yes</td>   </tr>
  </table>
<p class="sec_header"><span class="red">Bugs:</span></p>Results are undefined if |x| &gt;= 2<sup>64</sup>.</dd>
<dt class="decl">real <a class="symbol _function" name="sin" href="./htmlsrc/tango.math.Math.html#L336" kind="function" beg="336" end="350">sin</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#sin" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L336">#</a></dt>
<dd class="ddef">
<div class="summary">Returns sine of x. x is in radians.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x               <th> sin(x)      <th>invalid?
  <tr> <td> <span class="red">NAN</span>          <td> <span class="red">NAN</span>      <td> yes
  <tr> <td> &plusmn;0.0     <td> &plusmn;0.0 <td> no
  <tr> <td> &plusmn;&infin; <td> <span class="red">NAN</span>      <td> yes
  </table>
<p class="sec_header"><span class="red">Bugs:</span></p>Results are undefined if |x| &gt;= 2<sup>64</sup>.</dd>
<dt class="decl">real <a class="symbol _function" name="tan" href="./htmlsrc/tango.math.Math.html#L373" kind="function" beg="373" end="410">tan</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#tan" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L373">#</a></dt>
<dd class="ddef">
<div class="summary">Returns tangent of x. x is in radians.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
	<tr><th>x</th>               <th>tan(x)</th>       <th>invalid?</th></tr>
	<tr><td><span class="red">NAN</span></td>          <td><span class="red">NAN</span></td>       <td>yes</td></tr>
	<tr><td>&plusmn;0.0</td>    <td>&plusmn;0.0</td> <td>no</td></tr>
	<tr><td>&plusmn;&infin;</td> <td><span class="red">NAN</span></td>     <td>yes</td></tr>
	</table></dd>
<dt class="decl">real <a class="symbol _function" name="cosPi" href="./htmlsrc/tango.math.Math.html#L488" kind="function" beg="488" end="491">cosPi</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#cosPi" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L488">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="sinPi" href="./htmlsrc/tango.math.Math.html#L494" kind="function" beg="494" end="497">sinPi</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#sinPi" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L494">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="atanPi" href="./htmlsrc/tango.math.Math.html#L500" kind="function" beg="500" end="503">atanPi</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#atanPi" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L500">#</a></dt>
<dd class="ddef">
<div class="summary">Sine, cosine, and arctangent of multiple of &pi;</div>
Accuracy is preserved for large values of x.</dd>
<dt class="decl">creal <a class="symbol _function" name="sin:2" href="./htmlsrc/tango.math.Math.html#L522" kind="function" beg="522" end="526">sin</a><span class="params">(creal <em>z</em>)</span>; <a title="Permalink to this symbol" href="#sin:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L522">#</a></dt>
<dt class="decl">ireal <a class="symbol _function" name="sin:3" href="./htmlsrc/tango.math.Math.html#L529" kind="function" beg="529" end="532">sin</a><span class="params">(ireal <em>y</em>)</span>; <a title="Permalink to this symbol" href="#sin:3" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L529">#</a></dt>
<dd class="ddef">
<div class="summary">sine, complex and imaginary</div>
sin(z) = sin(z.re)*cosh(z.im) + cos(z.re)*sinh(z.im)i
<p class="bl"/>
 If both sin(&theta;) and cos(&theta;) are required,
 it is most efficient to use expi(&theta).</dd>
<dt class="decl">creal <a class="symbol _function" name="cos:2" href="./htmlsrc/tango.math.Math.html#L546" kind="function" beg="546" end="550">cos</a><span class="params">(creal <em>z</em>)</span>; <a title="Permalink to this symbol" href="#cos:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L546">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="cos:3" href="./htmlsrc/tango.math.Math.html#L553" kind="function" beg="553" end="556">cos</a><span class="params">(ireal <em>y</em>)</span>; <a title="Permalink to this symbol" href="#cos:3" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L553">#</a></dt>
<dd class="ddef">
<div class="summary">cosine, complex and imaginary</div>
cos(z) = cos(z.re)*cosh(z.im) + sin(z.re)*sinh(z.im)i</dd>
<dt class="decl">real <a class="symbol _function" name="acos" href="./htmlsrc/tango.math.Math.html#L577" kind="function" beg="577" end="580">acos</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#acos" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L577">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the arc cosine of x,
 returning a value ranging from -&pi;/2 to &pi;/2.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
      <tr><th>x</th>         <th>acos(x)</th> <th>invalid?</th></tr>
      <tr><td>&gt;1.0</td>  <td><span class="red">NAN</span></td>  <td>yes</td></tr>
      <tr><td>&lt;-1.0</td> <td><span class="red">NAN</span></td>  <td>yes</td></tr>
      <tr><td><span class="red">NAN</span></td>    <td><span class="red">NAN</span></td>  <td>yes</td></tr>
      </table></dd>
<dt class="decl">real <a class="symbol _function" name="asin" href="./htmlsrc/tango.math.Math.html#L600" kind="function" beg="600" end="603">asin</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#asin" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L600">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the arc sine of x,
 returning a value ranging from -&pi;/2 to &pi;/2.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
	<tr><th>x</th>            <th>asin(x)</th>      <th>invalid?</th></tr>
	<tr><td>&plusmn;0.0</td> <td>&plusmn;0.0</td> <td>no</td></tr>
	<tr><td>&gt;1.0</td>     <td><span class="red">NAN</span></td>       <td>yes</td></tr>
	<tr><td>&lt;-1.0</td>    <td><span class="red">NAN</span></td>       <td>yes</td></tr>
       </table></dd>
<dt class="decl">real <a class="symbol _function" name="atan" href="./htmlsrc/tango.math.Math.html#L622" kind="function" beg="622" end="625">atan</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#atan" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L622">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the arc tangent of x,
 returning a value ranging from -&pi;/2 to &pi;/2.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
	<tr><th>x</th>                 <th>atan(x)</th>      <th>invalid?</th></tr>
	<tr><td>&plusmn;0.0</td>      <td>&plusmn;0.0</td> <td>no</td></tr>
	<tr><td>&plusmn;&infin;</td> <td><span class="red">NAN</span></td>       <td>yes</td></tr>
  </table></dd>
<dt class="decl">real <a class="symbol _function" name="atan2" href="./htmlsrc/tango.math.Math.html#L659" kind="function" beg="659" end="662">atan2</a><span class="params">(real <em>y</em>, real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#atan2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L659">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the arc tangent of y / x,
 returning a value ranging from -&pi;/2 to &pi;/2.</div>
<p class="sec_header">Remarks:</p>The Complex Argument of a complex number z is given by
  Arg(z) = atan2(z.re, z.im)
<p class="bl"/>
  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> y           <th> x         <th> atan(y, x)
  <tr> <td> <span class="red">NAN</span>      <td> anything  <td> <span class="red">NAN</span>
  <tr> <td> anything    <td> <span class="red">NAN</span>    <td> <span class="red">NAN</span>
  <tr> <td> &plusmn;0.0       <td> &gt; 0.0  <td> &plusmn;0.0
  <tr> <td> &plusmn;0.0       <td> &plusmn;0.0     <td> &plusmn;0.0
  <tr> <td> &plusmn;0.0       <td> &lt; 0.0  <td> &plusmn;&pi;
  <tr> <td> &plusmn;0.0       <td> -0.0      <td> &plusmn;&pi;
  <tr> <td> &gt; 0.0    <td> &plusmn;0.0     <td> &pi;/2
  <tr> <td> &lt; 0.0    <td> &plusmn;0.0     <td> &pi;/2
  <tr> <td> &gt; 0.0    <td> &infin;  <td> &plusmn;0.0
  <tr> <td> &plusmn;&infin;  <td> anything  <td> &plusmn;&pi;/2
  <tr> <td> &gt; 0.0    <td> -&infin; <td> &plusmn;&pi;
  <tr> <td> &plusmn;&infin;  <td> &infin;  <td> &plusmn;&pi;/4
  <tr> <td> &plusmn;&infin;  <td> -&infin; <td> &plusmn;3&pi;/4
      </table></dd>
<dt class="decl">creal <a class="symbol _function" name="asin:2" href="./htmlsrc/tango.math.Math.html#L678" kind="function" beg="678" end="681">asin</a><span class="params">(creal <em>z</em>)</span>; <a title="Permalink to this symbol" href="#asin:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L678">#</a></dt>
<dd class="ddef">
<div class="summary">Complex inverse sine</div>
asin(z) = -i log( sqrt(1-z<sup>2</sup>) + iz)
 where both log and sqrt are complex.</dd>
<dt class="decl">creal <a class="symbol _function" name="acos:2" href="./htmlsrc/tango.math.Math.html#L694" kind="function" beg="694" end="697">acos</a><span class="params">(creal <em>z</em>)</span>; <a title="Permalink to this symbol" href="#acos:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L694">#</a></dt>
<dd class="ddef">
<div class="summary">Complex inverse cosine</div>
acos(z) = &pi/2 - asin(z)</dd>
<dt class="decl">real <a class="symbol _function" name="cosh" href="./htmlsrc/tango.math.Math.html#L708" kind="function" beg="708" end="711">cosh</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#cosh" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L708">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the hyperbolic cosine of x.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x                <th> cosh(x)     <th> invalid?
  <tr> <td> &plusmn;&infin;  <td> &plusmn;0.0 <td> no
      </table></dd>
<dt class="decl">real <a class="symbol _function" name="sinh" href="./htmlsrc/tango.math.Math.html#L729" kind="function" beg="729" end="732">sinh</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#sinh" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L729">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the hyperbolic sine of x.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x               <th> sinh(x)         <th> invalid?
  <tr> <td> &plusmn;0.0     <td> &plusmn;0.0     <td> no
  <tr> <td> &plusmn;&infin; <td> &plusmn;&infin; <td> no
      </table></dd>
<dt class="decl">real <a class="symbol _function" name="tanh" href="./htmlsrc/tango.math.Math.html#L750" kind="function" beg="750" end="753">tanh</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#tanh" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L750">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the hyperbolic tangent of x.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x               <th> tanh(x)      <th> invalid?
  <tr> <td> &plusmn;0.0     <td> &plusmn;0.0  <td> no
  <tr> <td> &plusmn;&infin; <td> &plusmn;1.0  <td> no
      </table></dd>
<dt class="decl">creal <a class="symbol _function" name="sinh:2" href="./htmlsrc/tango.math.Math.html#L767" kind="function" beg="767" end="771">sinh</a><span class="params">(creal <em>z</em>)</span>; <a title="Permalink to this symbol" href="#sinh:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L767">#</a></dt>
<dt class="decl">ireal <a class="symbol _function" name="sinh:3" href="./htmlsrc/tango.math.Math.html#L774" kind="function" beg="774" end="777">sinh</a><span class="params">(ireal <em>y</em>)</span>; <a title="Permalink to this symbol" href="#sinh:3" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L774">#</a></dt>
<dd class="ddef">
<div class="summary">hyperbolic sine, complex and imaginary</div>
sinh(z) = cos(z.im)*sinh(z.re) + sin(z.im)*cosh(z.re)i</dd>
<dt class="decl">creal <a class="symbol _function" name="cosh:2" href="./htmlsrc/tango.math.Math.html#L790" kind="function" beg="790" end="794">cosh</a><span class="params">(creal <em>z</em>)</span>; <a title="Permalink to this symbol" href="#cosh:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L790">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="cosh:3" href="./htmlsrc/tango.math.Math.html#L797" kind="function" beg="797" end="800">cosh</a><span class="params">(ireal <em>y</em>)</span>; <a title="Permalink to this symbol" href="#cosh:3" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L797">#</a></dt>
<dd class="ddef">
<div class="summary">hyperbolic cosine, complex and imaginary</div>
cosh(z) = cos(z.im)*cosh(z.re) + sin(z.im)*sinh(z.re)i</dd>
<dt class="decl">real <a class="symbol _function" name="acosh" href="./htmlsrc/tango.math.Math.html#L826" kind="function" beg="826" end="832">acosh</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#acosh" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L826">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the inverse hyperbolic cosine of x.</div>
Mathematically, acosh(x) = log(x + sqrt( x*x - 1))
<p class="bl"/>
 <table border=1 cellpadding=4 cellspacing=0>
  <tr><td>Domain</td> <td>1..&infin;</td></tr>
  <tr><td>Range</td> <td>1..log(real.max), &infin; </td></tr>
 </table>
  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
    <tr><th>x</th> <th>acosh(x) </th></tr>
    <tr><td><span class="red">NAN</span></td> <td><span class="red">NAN</span> </td></tr>
    <tr><td><1</td> <td><span class="red">NAN</span> </td></tr>
    <tr><td>1</td> <td>0       </td></tr>
    <tr><td>+&infin;</td> <td>+&infin;</td></tr>
  </table></dd>
<dt class="decl">real <a class="symbol _function" name="asinh" href="./htmlsrc/tango.math.Math.html#L862" kind="function" beg="862" end="871">asinh</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#asinh" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L862">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the inverse hyperbolic sine of x.</div>
Mathematically,
  <pre class="d_code">
<span class="i">asinh</span>(<span class="i">x</span>) =  <span class="i">log</span>( <span class="i">x</span> + <span class="i">sqrt</span>( <span class="i">x</span>*<span class="i">x</span> + <span class="n">1</span> )) <span class="lc">// if x &gt;= +0</span>
<span class="i">asinh</span>(<span class="i">x</span>) = -<span class="i">log</span>(-<span class="i">x</span> + <span class="i">sqrt</span>( <span class="i">x</span>*<span class="i">x</span> + <span class="n">1</span> )) <span class="lc">// if x &lt;= -0</span>
</pre>
<p class="bl"/>
  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
    <tr><th>x</th> <th>asinh(x)       </th></tr>
    <tr><td><span class="red">NAN</span></td> <td><span class="red">NAN</span>         </td></tr>
    <tr><td>&plusmn;0</td> <td>&plusmn;0      </td></tr>
    <tr><td>&plusmn;&infin;</td> <td>&plusmn;&infin;</td></tr>
  </table></dd>
<dt class="decl">real <a class="symbol _function" name="atanh" href="./htmlsrc/tango.math.Math.html#L903" kind="function" beg="903" end="907">atanh</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#atanh" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L903">#</a></dt>
<dt class="decl">creal <a class="symbol _function" name="atanh:2" href="./htmlsrc/tango.math.Math.html#L923" kind="function" beg="923" end="927">atanh</a><span class="params">(ireal <em>y</em>)</span>; <a title="Permalink to this symbol" href="#atanh:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L923">#</a></dt>
<dt class="decl">creal <a class="symbol _function" name="atanh:3" href="./htmlsrc/tango.math.Math.html#L930" kind="function" beg="930" end="934">atanh</a><span class="params">(creal <em>z</em>)</span>; <a title="Permalink to this symbol" href="#atanh:3" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L930">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the inverse hyperbolic tangent of x,
 returning a value from ranging from -1 to 1.</div>
Mathematically, atanh(x) = log( (1+x)/(1-x) ) / 2
<p class="bl"/>

 <table border=1 cellpadding=4 cellspacing=0>
  <tr><td>Domain</td> <td>-&infin;..&infin;</td></tr>
  <tr><td>Range</td> <td>-1..1</td></tr> </table>
  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
    <tr><th>x</th> <th>atanh(x) </th></tr>
    <tr><td><span class="red">NAN</span></td> <td><span class="red">NAN</span> </td></tr>
    <tr><td>&plusmn;0</td> <td>&plusmn;0</td></tr>
    <tr><td>&plusmn;1</td> <td>&plusmn;&infin;</td></tr>
  </table></dd>
<dt class="decl">float <a class="symbol _function" name="sqrt" href="./htmlsrc/tango.math.Math.html#L950" kind="function" beg="950" end="964">sqrt</a><span class="params">(float <em>x</em>)</span>; <a title="Permalink to this symbol" href="#sqrt" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L950">#</a></dt>
<dt class="decl">creal <a class="symbol _function" name="sqrt:2" href="./htmlsrc/tango.math.Math.html#L999" kind="function" beg="999" end="1023">sqrt</a><span class="params">(creal <em>z</em>)</span>; <a title="Permalink to this symbol" href="#sqrt:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L999">#</a></dt>
<dd class="ddef">
<div class="summary">Compute square root of x.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x        <th> sqrt(x)  <th> invalid?
  <tr> <td> -0.0     <td> -0.0     <td> no
  <tr> <td> &lt;0.0  <td> <span class="red">NAN</span>   <td> yes
  <tr> <td> +&infin; <td> +&infin; <td> no
  </table></dd>
<dt class="decl">real <a class="symbol _function" name="cbrt" href="./htmlsrc/tango.math.Math.html#L1046" kind="function" beg="1046" end="1049">cbrt</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#cbrt" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1046">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the cube root of x.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> <i>x</i>  <th> cbrt(x)    <th> invalid?
  <tr> <td> &plusmn;0.0   <td> &plusmn;0.0    <td> no
  <tr> <td> <span class="red">NAN</span>    <td> <span class="red">NAN</span>     <td> yes
  <tr> <td> &plusmn;&infin;   <td> &plusmn;&infin; <td> no
  </table></dd>
<dt class="decl">real <a class="symbol _function" name="exp" href="./htmlsrc/tango.math.Math.html#L1068" kind="function" beg="1068" end="1071">exp</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#exp" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1068">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates e<span style="vertical-align:super;font-size:smaller">x</span>.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x        <th> exp(x)
  <tr> <td> +&infin; <td> +&infin;
  <tr> <td> -&infin; <td> +0.0
  </table></dd>
<dt class="decl">real <a class="symbol _function" name="expm1" href="./htmlsrc/tango.math.Math.html#L1094" kind="function" beg="1094" end="1097">expm1</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#expm1" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1094">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the value of the natural logarithm base (e)
 raised to the power of x, minus 1.</div>
For very small x, expm1(x) is more accurate
 than exp(x)-1.
<p class="bl"/>
  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x           <th> e<span style="vertical-align:super;font-size:smaller">x</span>-1
  <tr> <td> &plusmn;0.0 <td> &plusmn;0.0
  <tr> <td> +&infin;    <td> +&infin;
  <tr> <td> -&infin;    <td> -1.0
  </table></dd>
<dt class="decl">real <a class="symbol _function" name="exp2" href="./htmlsrc/tango.math.Math.html#L1116" kind="function" beg="1116" end="1119">exp2</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#exp2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1116">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates 2<span style="vertical-align:super;font-size:smaller">x</span>.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x <th> exp2(x)
  <tr> <td> +&infin; <td> +&infin;
  <tr> <td> -&infin; <td> +0.0
  </table></dd>
<dt class="decl">real <a class="symbol _function" name="log" href="./htmlsrc/tango.math.Math.html#L1142" kind="function" beg="1142" end="1145">log</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#log" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1142">#</a></dt>
<dd class="ddef">
<div class="summary">Calculate the natural logarithm of x.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x           <th> log(x)   <th> divide by 0? <th> invalid?
  <tr> <td> &plusmn;0.0 <td> -&infin; <td> yes          <td> no
  <tr> <td> &lt; 0.0    <td> <span class="red">NAN</span>   <td> no           <td> yes
  <tr> <td> +&infin;    <td> +&infin; <td> no           <td> no
  </table></dd>
<dt class="decl">real <a class="symbol _function" name="log1p" href="./htmlsrc/tango.math.Math.html#L1168" kind="function" beg="1168" end="1171">log1p</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#log1p" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1168">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the natural logarithm of 1 + x.</div>
For very small x, log1p(x) will be more accurate than
  log(1 + x).
<p class="bl"/>
  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x           <th> log1p(x)    <th> divide by 0? <th> invalid?
  <tr> <td> &plusmn;0.0 <td> &plusmn;0.0 <td> no           <td> no
  <tr> <td> -1.0        <td> -&infin;    <td> yes          <td> no
  <tr> <td> &lt;-1.0    <td> <span class="red">NAN</span>      <td> no           <td> yes
  <tr> <td> +&infin;    <td> -&infin;    <td> no           <td> no
  </table></dd>
<dt class="decl">real <a class="symbol _function" name="log2" href="./htmlsrc/tango.math.Math.html#L1191" kind="function" beg="1191" end="1194">log2</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#log2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1191">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the base-2 logarithm of x:
 log<sub>2</sub>x</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x           <th> log2(x)  <th> divide by 0? <th> invalid?
  <tr> <td> &plusmn;0.0 <td> -&infin; <td> yes          <td> no
  <tr> <td> &lt; 0.0    <td> <span class="red">NAN</span>   <td> no           <td> yes
  <tr> <td> +&infin;    <td> +&infin; <td> no           <td> no
  </table></dd>
<dt class="decl">real <a class="symbol _function" name="log10" href="./htmlsrc/tango.math.Math.html#L1213" kind="function" beg="1213" end="1216">log10</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#log10" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1213">#</a></dt>
<dd class="ddef">
<div class="summary">Calculate the base-10 logarithm of x.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x           <th> log10(x) <th> divide by 0? <th> invalid?
  <tr> <td> &plusmn;0.0 <td> -&infin; <td> yes          <td> no
  <tr> <td> &lt; 0.0    <td> <span class="red">NAN</span>   <td> no           <td> yes
  <tr> <td> +&infin;    <td> +&infin; <td> no           <td> no
  </table></dd>
<dt class="decl">creal <a class="symbol _function" name="exp:2" href="./htmlsrc/tango.math.Math.html#L1236" kind="function" beg="1236" end="1239">exp</a><span class="params">(ireal <em>y</em>)</span>; <a title="Permalink to this symbol" href="#exp:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1236">#</a></dt>
<dt class="decl">creal <a class="symbol _function" name="exp:3" href="./htmlsrc/tango.math.Math.html#L1242" kind="function" beg="1242" end="1245">exp</a><span class="params">(creal <em>z</em>)</span>; <a title="Permalink to this symbol" href="#exp:3" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1242">#</a></dt>
<dd class="ddef">
<div class="summary">Exponential, complex and imaginary</div>
For complex numbers, the exponential function is defined as
<p class="bl"/>
  exp(z) = exp(z.re)cos(z.im) + exp(z.re)sin(z.im)i.
<p class="bl"/>
  For a pure imaginary argument,
  exp(&theta;i)  = cos(&theta;) + sin(&theta;)i.</dd>
<dt class="decl">creal <a class="symbol _function" name="log:2" href="./htmlsrc/tango.math.Math.html#L1277" kind="function" beg="1277" end="1280">log</a><span class="params">(creal <em>z</em>)</span>; <a title="Permalink to this symbol" href="#log:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1277">#</a></dt>
<dd class="ddef">
<div class="summary">Natural logarithm, complex</div>
Returns complex logarithm to the base e (2.718...) of
 the complex argument x.
<p class="bl"/>
 If z = x + iy, then
       log(z) = log(abs(z)) + i arctan(y/x).
<p class="bl"/>
 The arctangent ranges from -PI to +PI.
 There are branch cuts along both the negative real and negative
 imaginary axes. For pure imaginary arguments, use one of the
 following forms, depending on which branch is required.
 <pre class="d_code">
<span class="i">log</span>( <span class="n">0.0</span> + <span class="i">yi</span>) = <span class="i">log</span>(-<span class="i">y</span>) + <span class="i">PI_2i</span>  <span class="lc">// y&lt;=-0.0</span>
<span class="i">log</span>(-<span class="n">0.0</span> + <span class="i">yi</span>) = <span class="i">log</span>(-<span class="i">y</span>) - <span class="i">PI_2i</span>  <span class="lc">// y&lt;=-0.0</span>
</pre></dd>
<dt class="decl">real <a class="symbol _function" name="pow" href="./htmlsrc/tango.math.Math.html#L1305" kind="function" beg="1305" end="1336">pow</a><span class="params">(real <em>x</em>, uint <em>n</em>)</span>; <a title="Permalink to this symbol" href="#pow" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1305">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="pow:2" href="./htmlsrc/tango.math.Math.html#L1339" kind="function" beg="1339" end="1343">pow</a><span class="params">(real <em>x</em>, int <em>n</em>)</span>; <a title="Permalink to this symbol" href="#pow:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1339">#</a></dt>
<dd class="ddef">
<div class="summary">Fast integral powers.</div></dd>
<dt class="decl">real <a class="symbol _function" name="pow:3" href="./htmlsrc/tango.math.Math.html#L1387" kind="function" beg="1387" end="1481">pow</a><span class="params">(real <em>x</em>, real <em>y</em>)</span>; <a title="Permalink to this symbol" href="#pow:3" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1387">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates x<span style="vertical-align:super;font-size:smaller">y</span>.</div>
<table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
 <tr>
 <th> x <th> y <th> pow(x, y) <th> div 0 <th> invalid?
 <tr>
 <td> anything    <td> &plusmn;0.0    <td> 1.0    <td> no     <td> no
 <tr>
 <td> |x| &gt; 1  <td> +&infin;       <td> +&infin;   <td> no     <td> no
 <tr>
 <td> |x| &lt; 1  <td> +&infin;       <td> +0.0   <td> no     <td> no
 <tr>
 <td> |x| &gt; 1  <td> -&infin;       <td> +0.0   <td> no     <td> no
 <tr>
 <td> |x| &lt; 1  <td> -&infin;       <td> +&infin;   <td> no     <td> no
 <tr>
 <td> +&infin;    <td> &gt; 0.0       <td> +&infin;   <td> no     <td> no
 <tr>
 <td> +&infin;    <td> &lt; 0.0       <td> +0.0   <td> no     <td> no
 <tr>
 <td> -&infin;    <td> odd integer &gt; 0.0   <td> -&infin;   <td> no     <td> no
 <tr>
 <td> -&infin;    <td> &gt; 0.0, not odd integer  <td> +&infin;   <td> no     <td> no
 <tr>
 <td> -&infin;    <td> odd integer &lt; 0.0   <td> -0.0   <td> no     <td> no
 <tr>
 <td> -&infin;    <td> &lt; 0.0, not odd integer  <td> +0.0   <td> no     <td> no
 <tr>
 <td> &plusmn;1.0     <td> &plusmn;&infin;        <td> <span class="red">NAN</span>     <td> no     <td> yes
 <tr>
 <td> &lt; 0.0    <td> finite, nonintegral    <td> <span class="red">NAN</span>     <td> no     <td> yes
 <tr>
 <td> &plusmn;0.0     <td> odd integer &lt; 0.0   <td> &plusmn;&infin; <td> yes   <td> no
 <tr>
 <td> &plusmn;0.0     <td> &lt; 0.0, not odd integer  <td> +&infin;   <td> yes    <td> no
 <tr>
 <td> &plusmn;0.0     <td> odd integer &gt; 0.0   <td> &plusmn;0.0 <td> no    <td> no
 <tr>
 <td> &plusmn;0.0     <td> &gt; 0.0, not odd integer  <td> +0.0   <td> no     <td> no
 </table></dd>
<dt class="decl">real <a class="symbol _function" name="hypot" href="./htmlsrc/tango.math.Math.html#L1516" kind="function" beg="1516" end="1582">hypot</a><span class="params">(real <em>x</em>, real <em>y</em>)</span>; <a title="Permalink to this symbol" href="#hypot" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1516">#</a></dt>
<dd class="ddef">
<div class="summary">Calculates the length of the
 hypotenuse of a right-angled triangle with sides of length x and y.
 The hypotenuse is the value of the square root of
 the sums of the squares of x and y:</div>
sqrt(x&sup2; + y&sup2;)
<p class="bl"/>
 Note that hypot(x, y), hypot(y, x) and
 hypot(x, -y) are equivalent.
<p class="bl"/>
  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x               <th> y           <th> hypot(x, y) <th> invalid?
  <tr> <td> x               <td> &plusmn;0.0 <td> |x|         <td> no
  <tr> <td> &plusmn;&infin; <td> y           <td> +&infin;    <td> no
  <tr> <td> &plusmn;&infin; <td> <span class="red">NAN</span>      <td> +&infin;    <td> no
  </table></dd>
<dt class="decl">T <a class="symbol _function" name="poly" href="./htmlsrc/tango.math.Math.html#L1623" kind="function" beg="1623" end="1698">poly</a><span class="tparams">(T)</span><span class="params">(T <em>x</em>, T[] <em>A</em>)</span>; <a title="Permalink to this symbol" href="#poly" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1623">#</a></dt>
<dd class="ddef">
<div class="summary">Evaluate polynomial A(x) = a<sub>0</sub> + a<sub>1</sub>x + a<sub>2</sub>x&sup2; + a<sub>3</sub>x&sup3; ...</div>
Uses Horner's rule A(x) = a<sub>0</sub> + x(a<sub>1</sub> + x(a<sub>2</sub> + x(a<sub>3</sub> + ...)))
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>A</em></td><td>array of coefficients a<sub>0</sub>, a<sub>1</sub>, etc.</td></tr></table></dd>
<dt class="decl">bool <a class="symbol _function" name="feq" href="./htmlsrc/tango.math.Math.html#L1728" kind="function" beg="1728" end="1732">feq</a><span class="tparams">(int precision = MANTDIG_2, XReal=real, YReal=real)</span><span class="params">(XReal <em>x</em>, YReal <em>y</em>)</span>; <span class="attrs">[<span class="stc">deprecated</span>]</span> <a title="Permalink to this symbol" href="#feq" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1728">#</a></dt>
<dd class="ddef">
<div class="summary">Floating point "approximate equality".</div>
Return true if x is equal to y, to within the specified precision
 If roundoffbits is not specified, a reasonable default is used.</dd>
<dt class="decl">real <a class="symbol _function" name="floor" href="./htmlsrc/tango.math.Math.html#L1749" kind="function" beg="1749" end="1752">floor</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#floor" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1749">#</a></dt>
<dd class="ddef">
<div class="summary">Returns the value of x rounded downward to the next integer
 (toward negative infinity).</div></dd>
<dt class="decl">real <a class="symbol _function" name="ceil" href="./htmlsrc/tango.math.Math.html#L1764" kind="function" beg="1764" end="1767">ceil</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#ceil" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1764">#</a></dt>
<dd class="ddef">
<div class="summary">Returns the value of x rounded upward to the next integer
 (toward positive infinity).</div></dd>
<dt class="decl">real <a class="symbol _function" name="round" href="./htmlsrc/tango.math.Math.html#L1778" kind="function" beg="1778" end="1781">round</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#round" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1778">#</a></dt>
<dd class="ddef">
<div class="summary">Return the value of x rounded to the nearest integer.
 If the fractional part of x is exactly 0.5, the return value is rounded to
 the even integer.</div></dd>
<dt class="decl">real <a class="symbol _function" name="trunc" href="./htmlsrc/tango.math.Math.html#L1794" kind="function" beg="1794" end="1797">trunc</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#trunc" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1794">#</a></dt>
<dd class="ddef">
<div class="summary">Returns the integer portion of x, dropping the fractional portion.</div>
This is also known as "chop" rounding.</dd>
<dt class="decl">int <a class="symbol _function" name="rndint" href="./htmlsrc/tango.math.Math.html#L1814" kind="function" beg="1814" end="1830">rndint</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#rndint" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1814">#</a></dt>
<dt class="decl">long <a class="symbol _function" name="rndlong" href="./htmlsrc/tango.math.Math.html#L1833" kind="function" beg="1833" end="1849">rndlong</a><span class="params">(real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#rndlong" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Math.html#L1833">#</a></dt>
<dd class="ddef">
<div class="summary">Rounds x to the nearest int or long.</div>
This is generally the fastest method to convert a floating-point number
 to an integer. Note that the results from this function
 depend on the rounding mode, if the fractional part of x is exactly 0.5.
 If using the default rounding mode (ties round to even integers)
 rndint(4.5) == 4, rndint(5.5)==6.</dd></dl>
</div>
<div id="footer">
  <p>Portions Copyright (C) 2001-2005 Digital Mars.</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:04:13 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>